From: Jonas Ã…dahl Date: Thu, 24 Nov 2022 15:27:29 +0000 (+0100) Subject: shell/window-tracker: Disassociate windows on shutdown X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~405^2^2~229 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=2ca6e2e7e88a2f3c94afaff9f06da56249c4d879;p=gnome-shell.git shell/window-tracker: Disassociate windows on shutdown This avoids trying to deal with handling windows being unmanaged one by one after we destroyed the ShellGlobal. Part-of: --- diff --git a/src/shell-window-tracker.c b/src/shell-window-tracker.c index 8c3de6f32..991613ea3 100644 --- a/src/shell-window-tracker.c +++ b/src/shell-window-tracker.c @@ -631,6 +631,23 @@ on_startup_sequence_changed (MetaStartupNotification *sn, g_signal_emit (G_OBJECT (self), signals[STARTUP_SEQUENCE_CHANGED], 0, sequence); } +static void +on_shutdown (ShellGlobal *shell_global, + ShellWindowTracker *tracker) +{ + g_autoptr (GList) windows; + GList *l; + + windows = g_hash_table_get_keys (tracker->window_to_app); + for (l = windows; l; l = l->next) + { + MetaWindow *window = l->data; + + disassociate_window (tracker, window); + } + g_assert (g_hash_table_size (tracker->window_to_app) == 0); +} + static void shell_window_tracker_init (ShellWindowTracker *self) { @@ -646,6 +663,9 @@ shell_window_tracker_init (ShellWindowTracker *self) load_initial_windows (self); init_window_tracking (self); + + g_signal_connect (shell_global_get (), + "shutdown", G_CALLBACK (on_shutdown), self); } static void